package com.atyun;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class DtpUtil {

    static Map<String, DptExecutor> map = new ConcurrentHashMap<>();

    public static void put(String name, DptExecutor executor) {
        map.putIfAbsent(name, executor);
    }

    public static DptExecutor getDptExecutor(String poolName) {
        return map.get(poolName);
    }

    public static Collection<DptExecutor> getAllExecutor() {
        Collection<DptExecutor> values = map.values();
        return values;
    }

    public static Collection<String> getAllPoolName() {
        return map.keySet();
    }

}
